import request from "@/utils/request";

// 消息相关
const messageApi = {
	// 消息列表
	getmessagelist(data : GetMessageListParams) {
		return request.post<dataResult>({ url: "/api/customer/message/getlist", data });
	},
	// 消息已读
	read(data : ReadtParams) {
		return request.post<dataResult>({ url: "/api/customer/message/read", data });
	},
	// 消息删除
	del(data : DelParams) {
		return request.post<dataResult>({ url: "/api/customer/message/del", data });
	}
};

export default messageApi;

interface dataResult {
	data ?: any;
	message : string;
	status : number;
}

//消息列表请求参数
interface GetMessageListParams {
	page : number;
	limit : number;
	read : number | null;
}

interface ReadtParams {
	ids : number[];
}

interface DelParams {
	ids : number[];
}